/*
 ============================================================================
 Name        : Process.h
 Author      : James McQueen, Corwyn Simpson, Craig Markham
 Version     :
 Date        : 05/14/2012
 Description : TCSS-422 Operating Systems Scheduler
 ============================================================================
 */

#ifndef __PROCESS__
#define __PROCESS__

#define DEFAULT_REQ_SIZE 20

#define IO_REQUEST   1
#define MUTEX_ACQ    2
#define MUTEX_GIVE   3
#define SHARED_WRITE 4
#define SHARED_READ  5

/* Request */
typedef struct
{
    int type; //The type of request
    int enumeration; //which mutex/IO device to request
    int time; //At what step the request is made
} Request;

/*-------------------- Process --------------------*/
typedef struct
{
    int my_length; 		//Number of time steps before terminating. Length of thread.
    int my_num_requests;	//Number of requests to be generated during process run.
    Request** my_requests_ptr; 	//A pointer to an array of requests.
    int clock_count;
    int start_clock;
} Process;


/********************* Process Functions *********************/
Process* process_init();
void process_destroy(Process* process);
int process_getLength(Process* process);
int process_getClock(Process* process);
int process_getStartTime(Process* process);
int process_getNumRequests(Process* process);
Request** process_getRequests(Process* process);

//Need an increment where we need to
void process_setLength(Process* process, int length); 
void process_setNumRequests(Process* process, int num_requests);
void process_setStartTime(Process* process, int start_time); 
int process_addRequest(Process* process, Request request);
int process_delRequest(Process* process, int request_num);

#endif /* PROCESS_H_ */
